package DomainLayer;

import Annotations.ProcessNameAnnotation;

@ProcessNameAnnotation(Name="UserInfoChange")
public class UserInfoChangeProcess extends AbstractProcess{
    private UserEntity user;
    private String firstName;
    private String secondName;
    private String middleName;
    private String login;
    private String password;
	private String salt;
    private Gender gender;
    private Integer age;
    
    public void setFirstName(String firstName)
    {
           this.firstName = firstName;
    }
    
    public void setSecondName(String secondName)
    {
            this.secondName = secondName;
    }
    
    public void setMiddleName(String middleName)
    {
            this.middleName = middleName;
    }
    
    public void setLogin(String login)
    {
            this.login = login;
    }

    public void setPassword(String password)
    {
            this.password = password;
    }

	public void setSalt(String salt)
    {
            this.salt = salt;
    }
	
    public void setGender(Gender gender)
    {
            this.gender = gender;
    }

    public void setAge(Integer age)
    {
            this.age = age;
    }
    
    public UserEntity getUser() 
    {
            return user;
    }
    
    public void setUser(UserEntity user) 
    {
            this.user = user;
    }
    
    @Override
    public void process()
    {
        super.process();
        setStatus(ProcessStatus.InProcess);
        getUser().setUserInfo(new UserInfoValueObject(getUser().getUserInfo(), firstName, secondName,
                middleName, login, password, salt, gender, age));
        setStatus(ProcessStatus.Completed);
    }
}
